<?php
namespace Home\Controller;
use Think\Controller;
class SController extends CommonController {
    public function index(){

    	$w = I('get.w');

    	$worlds = getWords($w);

    	// var_dump($worlds);

    	$sql ="select * from question where ";

    	foreach ($worlds as  $v) {
    		$sql .="title like '%".$v['word']."%' or ";
    	}

    	$sql = rtrim($sql,'or ');

    	$res = M()->query($sql);

    	var_dump($res);
        // $this->display();
    }
}